﻿#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>

typedef double Real;

typedef struct {
	int b;
	int a;
}Rational;

typedef struct {
	int m;
	int n;
	int data[20][20];
}Matrix;
 
typedef struct 
{
	int n;
	Rational rs[200];
}Context;

Context context;

Rational read_rational()
{
	Rational r;
	scanf("%d/%d", &r.a, &r.b);
	return r;
}

void swap(int* a, int* b)
{
	int c = *a;
	*a = *b;
	*b = c;
}
int gcd(int a, int b)
{
	if (a > b)
		swap(&a, &b);
	int c;
	while (c = a % b) {
		a = b;
		b = c;
	}
	return b;
}

Rational add(Rational* r1, Rational* r2)
{
	Rational r;
	int b0 = gcd(r1->b, r2->b);
	r.a = r1->a * (r2->b/b0) + r2->a * (r1->b/b0);
	r.b = r1->b / b0 * r2->b;
	b0 = gcd(r.b, r.a);
	r.b /= b0;
	r.a /= b0;
	return r;
}

void dump_rational(Rational* r)
{
	printf("%d", r->a);
	if (r->b != 1)
		printf("/%d", r->b);
	printf("\n");
}

Matrix* read_mat(Matrix* A)
{
	scanf("%d %d", &A->m, &A->n);
	for (int i = 0; i < A->m; ++i)
		for (int j = 0; j < A->n; ++j)
			scanf("%d", &A->data[i][j]);
	return A;
}

void get_line(char* s)
{
	char a;
	while (scanf("%c", &a))
	{
		if (a == '\r')
			;
		else if (a == '\n')
			break;
		else
			*s++ = a;
	}
	*s = 0;
}

void read_data(Context* ctx)
{
	scanf("%d", &ctx->n);
	for (int i = 0; i < ctx->n; ++i)
		ctx->rs[i]=read_rational();
}

void do_task(Context* ctx)
{
	Rational c = { 1,0 };
	for (int i = 0; i < ctx->n; ++i)
		c = add(&c, &ctx->rs[i]);
	int a0 = gcd(c.a, ctx->n);
	c.a /= a0;
	c.b *= (ctx->n / a0);
	dump_rational(&c);
}

void solve(Context* ctx)
{
	read_data(ctx);
	do_task(ctx);
}

int main()
{
	freopen("D:/Develop/GitRepos/MOOC/浙江大学/数据结构/201906/DataStructure/M2019秋C入门和进阶练习集/7-161.txt", "r", stdin);
	solve(&context);
	return 0;
}
